﻿<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list"
    style="padding: 20px 30px 0 0;">

    <input type='hidden' name='GoodIds' id="GoodIds" />
    <div class='layui-form-item'>
        <label class='layui-form-label'></label>
        <span style="font-weight:bold;color:green">已选择 <span style="color:red;font-size:1.2em" id="snum">0</span>
            个商品</span>
    </div>
    <div class='layui-form-item'>
        <label class='layui-form-label'></label>
        <span style="color:green">注：商品批量加入团购时，可先随意设置团购价且设置为不显示， 再前往 运营管理>团购商品中修改团购价后，设置为显示</span>
    </div>
    <div class='layui-form-item'>
        <label class='layui-form-label'>团购价<span style="color:red">*</span></label>
        <div class='layui-input-inline'>
            <input type='text' name='GroupPrice' lay-verify='required|number' placeholder='团购价' autocomplete='off'
                class='layui-input'>
        </div>
    </div>
    <div class='layui-form-item'>
        <label class='layui-form-label'>开始时间<span style="color:red">*</span></label>
        <div class='layui-input-inline'>
            <input type='text' name='StartTime' readonly='readonly' id='StartTime' lay-verify='datetime'
                placeholder='yyyy-MM-dd HH:mm:ss' autocomplete='off' class='layui-input'>
        </div>
    </div>

    <div class='layui-form-item'>
        <label class='layui-form-label'>结束时间<span style="color:red">*</span></label>
        <div class='layui-input-inline'>
            <input type='text' name='EndTime' readonly='readonly' id='EndTime' lay-verify='datetime'
                placeholder='yyyy-MM-dd HH:mm:ss' autocomplete='off' class='layui-input'>
        </div>
    </div>

    <div class='layui-form-item'>
        <label class='layui-form-label'>成团人数<span style="color:red">*</span></label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='GroupNum' value='2' lay-verify='required|number' placeholder='成团人数' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
    
    <div class='layui-form-item'>
        <label class='layui-form-label'>团购限购数<span style="color:red">*</span></label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='GroupGoodNum' value='1' lay-verify='required|number' placeholder='团购限购数' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>

    <div class='layui-form-item'>
        <label class='layui-form-label'>参团有效期 <span style="color:red">*</span></label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='VailHour' value='12' lay-verify='required|Ndouble' placeholder='参团有效期 (小时)' autocomplete='off' class='layui-input'>
            </script>
        </div>
        (小时。只能填写整数)
    </div>
    <div class='layui-form-item'>
        <label class='layui-form-label'>是否显示 <span style="color:red">*</span></label>
        <div class='layui-input-inline'>
            <select name='IsAble_Sel'>
                <option value='1'>不显示</option>
                <option value='0'>显示</option>
            </select>
        </div>
    </div>

    <div class='layui-form-item'>
        <label class='layui-form-label'>备注</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='RMK' lay-verify='' placeholder='备注' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
    <div class='layui-form-item'>
        <label class='layui-form-label'>排序<span style="color:red">*</span></label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='Sort' value='0' lay-verify='required|number' placeholder='排序' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" value="确认" class="layui-btn">
        </div>
    </div>
</div>

<script type="text/javascript">
    layui.use(['form', 'admin', 'upload', 'laydate'], function () {
        var form = layui.form;//required（必填项）phone（手机号）email（邮箱）url（网址）number（数字）date（日期）identity（身份证） 自定义值
        var laydate = layui.laydate;
        var admin = layui.admin;
        var $ = layui.$;


        form.verify({
            Ndouble: [
                /^[1-9]\d*$/
                , '只能输入整数哦'
            ]
        });

        //日期时间选择器
        laydate.render({
            elem: '#StartTime'
            , type: 'datetime'
            , calendar: true
        });

        //日期时间选择器
        laydate.render({
            elem: '#EndTime'
            , type: 'datetime'
            , calendar: true
        });

        $("#snum").text(checkids.length);
        $("#GoodIds").val(JSON.stringify(checkids));

    });


</script>